<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div th:fragment="header">
    <div class="top-header">
        <div class="top-left">
            <span>欢迎光临eBusiness</span>
            <th:block th:if="${session.currentUser == null}">
                <a th:href="@{/register.html}">注册</a>
                <a th:href="@{/login.html}">登录</a>
            </th:block>
            <th:block th:if="${session.currentUser != null}">
                <span>欢迎<span th:text="${session.currentUser.bemail}"></span></span>
                <a href="#" onclick="return false;">后台</a>
            </th:block>
        </div>
        <div class="top-right">
            <a th:href="@{/personalInfo}">个人信息</a>
            <a th:href="@{/cart}">我的购物车</a>
            <a th:href="@{/favorites}">我的收藏</a>
            <a th:href="@{/orders}">我的订单</a>
            <div class="dropdown">
                <a href="#" class="dropbtn">关于我们 <i class="arrow down"></i></a>
                <div class="dropdown-content">
                    <p>欢迎来到eBusiness，您的一站式购物平台！我们致力于为您提供优质的商品和卓越的购物体验。从家电到时尚服饰，从新鲜水果到文具鲜花，我们应有尽有。感谢您的支持，期待与您共同成长！</p>
                    <p>联系我们：service@eBusiness.com</p>
                </div>
            </div>
            <th:block th:if="${session.currentUser != null}">
                <a th:href="@{/logout}">退出</a>
            </th:block>
             <th:block th:if="${session.currentUser == null}">
                <!-- 未登录时，图片中顶部右侧没有退出链接 -->
            </th:block>
        </div>
    </div>
    <!-- main-header 将被移除，并作为独立组件添加到 index.html 中 -->
</div>
</body>
</html> 